<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" src="../js/vue.js">
		</script>



	</head>
	<body>
		<div id="app">

			<input type="text" v-model="firstname" />
			+
			<input type="text" v-model="lastname" />
			=
			<input type="text" v-model="fullname" />

		</div>
		<script>
			new Vue({
				el: '#app',
				data: {
					firstname: '',
					lastname: '',
					fullname: '',
				},
				methods: {},
				watch:{
					firstname:function(newValue,oldValue){
						this.fullname=newValue+'-'+this.lastname
					},
					lastname:function(newValue){
						this.fullname=this.firstname+'-'+newValue
					}
				}

			})
		</script>
	</body>
</html>
